package top.linyuxb.lycloud.admin.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import top.linyuxb.lycloud.admin.config.CustomEntityAuditingListener;

import java.sql.Timestamp;

/**
 * Created by Intellij IDEA.
 *
 * @Author: linyuxb
 * @Date: 2024/7/30 17:38
 * @Desc:
 */
@Getter
@Setter
@MappedSuperclass
@EntityListeners({AuditingEntityListener.class, CustomEntityAuditingListener.class})
public class BaseEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private Integer status;

    @CreatedBy
    private Long creatorId;
    @LastModifiedBy
    private Long lastModifierId;
    @CreatedDate
    private Timestamp ctime;
    @LastModifiedDate
    private Timestamp utime;
}
